#!/bin/bash
# Redis installer
###SHELLPACK preamble redis-install 3.0.5
WEB_LOCATION=http://download.redis.io/releases
MIRROR_LOCATION="$WEBROOT/redis/"

###SHELLPACK parseargBegin
###SHELLPACK parseargEnd

###SHELLPACK sources_fetch redis-${VERSION}.tar.gz redis-${VERSION}

###SHELLPACK build_start redis-${VERSION}
###SHELLPACK make
make PREFIX=$SHELLPACK_SOURCES/redis-${VERSION}-installed install || die Failed to install redis

mkdir $SHELLPACK_SOURCES/redis-${VERSION}-installed/etc || die Failed to create configuration directory
cat redis.conf | sed -e 's/^save.*//' > $SHELLPACK_SOURCES/redis-${VERSION}-installed/etc/redis-memonly.conf
cp redis.conf $SHELLPACK_SOURCES/redis-${VERSION}-installed/etc/redis-default-persist.conf

echo Redis installed successfully
